﻿@{
    var db = new ShenLanCMS.Models.EntityContext();

    var ads = from n in db.Ads select n;
    var ran = new Random().Next(ads.Count());
    var ad = ads.ToList();
    var html = "暂无广告";
    if (ads.Count() > 0)
    {
        html = ad[ran].Content;
    }

    var siteinfo = db.Siteinfoes;
    var str = "";
    var siteName = "";
    foreach (var item in siteinfo)
    {
        str += item.SiteName + " 站点关键词:" + item.Keyword + "  <br/>网站备案号:" + item.SiteRecord + "站长邮箱:<a href=mailto:" + item.SiteMail + ">" + item.SiteMail + "</a>";
        ViewBag.keywords = item.Keyword;
        ViewBag.description = item.Description;
        siteName = item.SiteName;
    }
}
<!DOCTYPE html>
<html>
<head>
    <title>@ViewBag.Title - @siteName</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="keywords" content="@ViewBag.keywords" />
    <meta name="description" content="@ViewBag.description" />
    <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
    <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>
</head>
<body>
    <div class="page">
        <div id="header">
            <div id="layoutTitle">
                <h1>
                    ShenLanCMS
                </h1>
            </div>
            <div id="logindisplay">
                @Html.Partial("_LogOnPartial")
            </div>
            <div id="menucontainer">
                <ul id="menu">
                    <li><a href="/">主页</a></li>
                    <li><a href="/post/alltype">所有分类</a></li>
                    <li><a href="/msgboard/index">留言板</a></li>
                    <li><a href="/link/index">友情链接</a></li>
                    <li><a href="/search/index">搜索</a></li>
                    <li><a href="/tag/index">标签</a></li>
                </ul>
            </div>
        </div>
        <div id="main">
            @RenderBody()
            <div>
                <span>底部广告</span>
                <ul style="text-align: center;">
                    @Html.Raw(html)
                </ul>
            </div>
        </div>
        <div id="footer">
            @Html.Raw(str)
        </div>
    </div>
</body>
</html>
